{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import pydicom\n",
    "import os\n",
    "import matplotlib.pyplot as plt\n",
    "import cv2\n",
    "import math\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Reduced Image pixel size and the depth to process data without cloud\n",
    "IMG_PXL_SIZE = 50\n",
    "HM_SLICES = 20"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Data Path\n",
    "data_labels = pd.read_csv('D:/Documents/Major Project/Jupyter Notebooks/stage1_labels.csv',index_col=0)\n",
    "data_dir = 'D:/Documents/Major Project/sample_images/'\n",
    "patients = os.listdir(data_dir)\n",
    "test_patients = pd.read_csv('D:/Documents/Major Project/Jupyter Notebooks/stage1_sample_submission.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 198 entries, 0 to 197\n",
      "Data columns (total 2 columns):\n",
      "id        198 non-null object\n",
      "cancer    198 non-null float64\n",
      "dtypes: float64(1), object(1)\n",
      "memory usage: 3.2+ KB\n"
     ]
    }
   ],
   "source": [
    "test_patients.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(patients) # sample data of 20 patients"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Function to break a list of slices into chunks of lists\n",
    "def chunks(l, n):\n",
    "    \"\"\"Yield successive n-sized chunks from l.\"\"\"\n",
    "    for i in range(0, len(l), n):\n",
    "        yield l[i:i + n]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def mean(l):\n",
    "    return sum(l)/len(l)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Function to limit depth\n",
    "\n",
    "This function will limit the depth of 3-D CT Scans to 20 slices. Because of variable number of slices, it can not be used with a neural network"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Function to process data\n",
    "def process_data(patient, data_labels, img_pxl_size=20, hm_slices=20, vizualize = False):\n",
    "\n",
    "    label = data_labels.get_value(patient,'cancer')\n",
    "    path = data_dir + patient\n",
    "    slices = [dicom.read_file(path + '/' + s) for s in os.listdir(path)]\n",
    "    slices.sort(key = lambda x: float(x.ImagePositionPatient[2]))\n",
    "    #print(len(slices), label)\n",
    "    #print(slices[0])\n",
    "    #plt.imshow(slices[0].pixel_array)\n",
    "    #plt.show()\n",
    "\n",
    "    new_slices = []\n",
    "\n",
    "    slices = [cv2.resize(np.array(each_slice.pixel_array),(IMG_PXL_SIZE,IMG_PXL_SIZE)) for each_slice in slices]\n",
    "\n",
    "    chunk_sizes = math.ceil(len(slices) / HM_SLICES)\n",
    "\n",
    "\n",
    "\n",
    "    for slice_chunk in chunks(slices,chunk_sizes):\n",
    "        slice_chunk = list(map(mean, zip(*slice_chunk)))\n",
    "        new_slices.append(slice_chunk)\n",
    "\n",
    "\n",
    "    if len(new_slices) == HM_SLICES-1:\n",
    "        new_slices.append(new_slices[-1])\n",
    "\n",
    "    if len(new_slices) == HM_SLICES-2:\n",
    "        new_slices.append(new_slices[-1])\n",
    "        new_slices.append(new_slices[-1])\n",
    "\n",
    "    if len(new_slices) == HM_SLICES+2:\n",
    "        new_val = list(map(mean, zip(*[new_slices[HM_SLICES-1],new_slices[HM_SLICES]])))\n",
    "        del new_slices[HM_SLICES]\n",
    "        new_slices[HM_SLICES-1] = new_val\n",
    "\n",
    "    if len(new_slices) == HM_SLICES+1:\n",
    "        new_val = list(map(mean, zip(*[new_slices[HM_SLICES-1],new_slices[HM_SLICES]])))\n",
    "        del new_slices[HM_SLICES]\n",
    "        new_slices[HM_SLICES-1] = new_val\n",
    "\n",
    "\n",
    "    if vizualize:\n",
    "        fig = plt.figure()\n",
    "        for num,each_slice in enumerate(slices[:12]):\n",
    "            y = fig.add_subplot(4,5,num+1)\n",
    "            #new_image = scipy.misc.imresize(np.array(each_slice.pixel_array),(IMG_PXL_SIZE,IMG_PXL_SIZE))\n",
    "            #y.imshow(slices[0].pixel_array)\n",
    "            #y.imshow(each_slice)\n",
    "\n",
    "        plt.show()\n",
    "\n",
    "    if label == 1: label = np.array([0,1])\n",
    "    elif label == 0: label = np.array([1,0])\n",
    "\n",
    "    return np.array(new_slices), label"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Function to process CT Scans and save them as #-Dimensional Arrays forneural network\n",
    "\n",
    "** This function converted approximatey 150 Gigabytes of CT Scan data to just ~850 Megabytes of numpy arrays**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "50\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "100\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "150\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "200\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "250\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "300\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "350\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "400\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "450\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "500\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "550\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "600\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "650\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "700\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(17, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "750\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "800\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "850\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "900\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "950\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "1000\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "1050\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "1100\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "1150\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "1200\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "1250\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "1300\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "1350\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "1400\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "1450\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "1500\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "1550\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [0 1]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) \tThis is unlabeled data\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "(20, 50, 50) [1 0]\n",
      "Finished processing\n"
     ]
    }
   ],
   "source": [
    "# Save processed data in a list\n",
    "\n",
    "train_data = []\n",
    "\n",
    "test_data = []\n",
    "\n",
    "for num, patient in enumerate(patients):\n",
    "        if num%50 == 0:\n",
    "            print(num)\n",
    "\n",
    "        try:\n",
    "            img_data, label = process_data(patient, data_labels, img_pxl_size=IMG_PXL_SIZE, hm_slices=HM_SLICES)\n",
    "            train_data.append([img_data,label])\n",
    "            print(img_data.shape, label)\n",
    "\n",
    "        except KeyError as e:\n",
    "            test_data.append([img_data])\n",
    "            print(img_data.shape , '\\tThis is unlabeled data')\n",
    "\n",
    "np.save('traindata-{}-{}-{}.npy'.format(IMG_PXL_SIZE,IMG_PXL_SIZE,HM_SLICES), train_data)\n",
    "np.save('testdata-{}-{}-{}.npy'.format(IMG_PXL_SIZE,IMG_PXL_SIZE,HM_SLICES), test_data)\n",
    "print('Finished processing')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
